{include file="public/header"}
<style type="text/css">
	#wrapper {
        width: 100%;
        position: absolute;
        left: 0;
        top: 40px;
        overflow: hidden;
        z-index: 1;
        /* 防止本机Windows上的触摸事件 */
        -ms-touch-action: none;
        /* 防止callout tap-hold和文本的选择 */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        /* 防止文本调整取向变化对web应用程序很有用 */
        -webkit-text-size-adjust: none;
        -moz-text-size-adjust: none;
        -ms-text-size-adjust: none;
        -o-text-size-adjust: none;
        text-size-adjust: none;
		height: 300px;
    }
    .w_section3 .w_3{
        padding-top: 0px !important;
    }
    .pull-loading {
        text-align: center;
        height: 40px;
        line-height: 40px;
        display: flex;
        align-items: center;
		color: #fff;
        justify-content: center;
    }
    #scroller ul li {}
</style>
<body class="she_body">
<div class="bg_fixed_v10_1"></div>
<div class="sectionY sectionY_tttt">
		<a href="{:url('User/index')}">
			<img src="__PUBLIC__/home/images/v10_a9.png" alt="" class="a1">
		</a>
		<p class="p1">
			<span class="ppp_title">预约记录</span>
		</p>
	</div>
	<div class="kong1"></div>

	<div class="w_section3" id='wrapper'>
		<div class="w_3" style="padding-top:0px;" id="scroller">
			<ul>
                {volist name='list' id='v'}
    				<li class="clearfix">
						<div class="big clearfix">
    					<div class="a1">
    						<p class="p1"><span class="s3">-{$v.delpoint|intval} 个共享豆</span></p>
                            {if condition="$v['isadd'] eq 2"}
                                <p class="p2">

                                    <span class="s4">{$v.title}</span>
                                    <span class="s5"></span>
                                </p>
                            {/if}
                            {if condition="$v['isadd'] eq 1"}
                                <p class="p2">
                                    <span class="s5">+{$v.delpoint|intval} 个共享豆</span></span>
                                    <span class="s4"></span>
                                    <span class="s5"></span>
                                </p>
                            {/if}
    					</div>
    					<div class="a2" style="margin-top:4px;">
    						<p class="p1">{$v.ctime|date='Y-m-d H:i:s',###}</p>
    					</div>
						</div>
    				</li>
                {/volist}
			</ul>
            <div class="pull-loading">上拉加载</div>
		</div>

	</div>
<style>
	.footer1 .p1{
		margin-top:1px;font-weight: bold;
	}
</style>
<!--	{include file="public/newfoot"}-->
</body>
</html>

<script type="text/javascript">
    $(function(){
        var dd = $("#wrapper").offset().top;
        $("#wrapper").css("height",($(window).height()-dd-80));
        $("#wrapper").css("top",dd+20);
    })
</script>
<script type="text/javascript">
    var myscroll = new iScroll("wrapper", {
        onScrollMove: function () { //拉动时
            //上拉加载
            if (this.y < this.maxScrollY) {
                $(".pull-loading").html("释放加载");
                $(".pull-loading").addClass("loading");
            } else {
                $(".pull-loading").html("上拉加载");
                $(".pull-loading").removeClass("loading");
            }
        },
        onScrollEnd: function () { //拉动结束时
            //上拉加载
            if ($(".pull-loading").hasClass('loading')) {
                $(".pull-loading").html("加载中...");
                pullOnLoad();
            }
        }
    });
    //上拉加载函数,ajax
    var num = 1;
    function pullOnLoad() {
        num++;
        $.ajax({
            type:'post',
            url:"{:url('Rent/ajaxmoreapply')}",
            data:{page:num},
            cache:false,
            dataType:'JSON',
            success:function(data){
                //console.log(data);return;
                if(data.length<=0){
                    $('.pull-loading').html("已加载全部");
                }else{
                    var html = '';
                    for(var i=0;i<data.length;i++){
                        var isadd =
                        html += '<li class="clearfix">';
						html += '   <div class="big clearfix">';
                        html += '   <div class="a1">';
                        html += '      <p class="p1"><span class="s3">'+data[i]['title']+'</span></p>';
                        if(data[i]['isadd']==1){
                            html += '      <p class="p2"><span class="s5">花费共享豆：</span></span><span class="s4">-'+data[i]['delpoint']+'</span><span class="s5">个</span></p>';
                        }
                        if(data[i]['isadd']==2){
                                html += '      <p class="p2"><span class="s5">获得共享豆：</span></span><span class="s4">+'+data[i]['delpoint']+'</span><span class="s5">个</span></p>';
                        }
                        html += '   </div><div class="a2" style="margin-top:4px;">';
                        html += '   <p class="p1">'+data[i]['ctime']+'</p>';
                        html += '    </div>';
						html += '    </div>';
                        html += '</li>';
                    }
                    $("#scroller ul").append(html);
                    $('.pull-loading').html("上拉加载");
                }
				myscroll.refresh();
            }
        });
    }
    pullOnLoad();
</script>
